/*
 * Territory.cpp
 *
 *  Created on: Apr 11, 2009
 *      Author: Brad Pearson
 */

#include<iostream>
#include<string>
#include<vector>

using namespace std;

#include "player.h"
#include "Territory.h"

Territory::Territory() :
        m_player(NULL),
        m_strength(0)
{
}

Territory::~Territory()
{
    m_player = NULL;

    for(unsigned int n = 0;n < m_neighbors.size();++n)
    {
        m_neighbors[n] = NULL;
    }
}

void Territory::addNeighbor(Territory* neighbor)
{
    m_neighbors.push_back(neighbor);
}

bool Territory::isNeighbor(Territory* territory)
{
    for(unsigned int n = 0;n < m_neighbors.size();++n)
    {
        if(m_neighbors.at(n) == territory)
            return true;
    }
    return false;
}
